/**
 * 
 */
package com.oolong.account.service;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import com.oolong.account.dal.StaticDAO;
import com.oolong.account.dal.UserDAO;
import com.oolong.account.vo.DateStaticVo;
import com.oolong.account.vo.MonthStaticVo;
import com.oolong.account.vo.TotalStaticVo;

/**
 * @author oolong
 * 
 */
public class StaticManageImp implements StaticManage {
	StaticDAO staticDAO;
	UserDAO userDAO;

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.oolong.account.service.StaticManageInterface#MonthStaticService()
	 */
	@Override
	public List<MonthStaticVo> MonthStaticService(Integer user_id) {
		// 因VO层与DAO层的数据内容一致，因此不需要做转换
		// 定义返回的数据
		List<MonthStaticVo> monthStaticVos = new ArrayList();
		monthStaticVos = staticDAO.selectbymonth(user_id);
		// 返回LIST
		return monthStaticVos;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.oolong.account.service.StaticManage#DateDayStaticService(int)
	 */
	@Override
	public List<DateStaticVo> DayStaticService(Integer user_id) {
		// 因VO层与DAO层的数据内容一致，因此不需要做转换
		// 定义返回的数据
		List<DateStaticVo> dateStaticVos = new ArrayList();
		dateStaticVos = staticDAO.selectByday(user_id);
		// 返回LIST
		return dateStaticVos;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.oolong.account.service.StaticManage#DateDayStaticService(java.util
	 * .Date, java.util.Date)
	 */
	@Override
	public List<DateStaticVo> DayBtwStaticService(Integer user_id,
			Date startday, Date endday) {
		// 因VO层与DAO层的数据内容一致，因此不需要做转换
		// 定义返回的数据
		List<DateStaticVo> dateStaticVos = new ArrayList<DateStaticVo>();
		dateStaticVos = staticDAO.selectBybtwday(user_id, startday, endday);
		// 返回LIST
		return dateStaticVos;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.oolong.account.service.StaticManage#TypeBtwStaticService(java.lang
	 * .Integer, java.util.Date, java.util.Date)
	 */
	@Override
	public List<DateStaticVo> TypeBtwStaticService(Integer user_id,
			Date startday, Date endday) {
		// 因VO层与DAO层的数据内容一致，因此不需要做转换
		// 定义返回的数据
		List<DateStaticVo> dateStaticVos = new ArrayList<DateStaticVo>();
		dateStaticVos = staticDAO.selectTypeBybtwday(user_id, startday, endday);
		// 返回LIST
		return dateStaticVos;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.oolong.account.service.StaticManage#TotalLastStaticService(java.lang
	 * .Integer)
	 */
	@Override
	public TotalStaticVo TotalLastStaticService(Integer user_id) {
		// 因VO层与DAO层的数据内容一致，因此不需要做转换
		// 定义返回的数据
		TotalStaticVo totalStaticVo = new TotalStaticVo();
		totalStaticVo = staticDAO.selecttotallast(user_id);
		return totalStaticVo;
	}

	/**
	 * @param staticDAO
	 *            the staticDAO to set
	 */
	public void setStaticDAO(StaticDAO staticDAO) {
		this.staticDAO = staticDAO;
	}

	/**
	 * @param userDAO
	 *            the userDAO to set
	 */
	public void setUserDAO(UserDAO userDAO) {
		this.userDAO = userDAO;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.oolong.account.service.StaticManage#OneMonthStaticService(java.lang
	 * .Integer, java.lang.String)
	 */
	@Override
	public MonthStaticVo OneMonthStaticService(Integer user_id, String month) {
		// 因VO层与DAO层的数据内容一致，因此不需要做转换
		// 定义返回的数据
		MonthStaticVo monthStaticVo = staticDAO
				.selectbyOnemonth(user_id, month);
		// 返回LIST
		return monthStaticVo;
	}

}
